<?php
/* CORE LOAD CSS
 *
 * Carga todos los css permanentes del sitio web, la lista la obtiene
 * del config.ini
 *
 */

foreach($this->config->layout->javascript as  $key => $name){
    echo cargarJS($this->config, $name, $this->baseUrl);
}

function cargarJS($config, $filename, $baseUrl){

    $path =
        realpath('.')   . DIRECTORY_SEPARATOR
        .'scripts'       . DIRECTORY_SEPARATOR;

    if(file_exists($path . $filename)){

        return '<script src="'.$baseUrl.'/scripts/'.$filename.'" type="text/javascript"></script>'."\n";

    }else{
            if(substr_count($filename, 'http')){
                 return '<script src="'.$filename.'" type="text/javascript"></script>'."\n";
            }
        return '<!-- No existe ' . $filename . '-->'."\n";
    }
}